package com.service.impl;

import com.dao.CommodityMapper;
import com.model.pojo.Commodity;
import com.service.ICommodityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommodityServiceIpml implements ICommodityService {
    @Resource
    private CommodityMapper commodityMapper;
    @Override
    public boolean addCom(Commodity commodity) {
        int i=0;
        i=commodityMapper.addCommodity(commodity);
        if (i>0){
            return true;
        }
        return false;
    }

    @Override
    public List<Commodity> selectbyname(Commodity commodity) {

        return commodityMapper.findAll(commodity);
    }

    @Override
    public boolean delbyid(Commodity commodity) {
        int i=0;
        i=commodityMapper.del(commodity);
        if (i>0){
            return true;
        }
        return false;

    }
}
